#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <omp.h>

#define ceild(n,d)  ceil(((double)(n))/((double)(d)))
#define max(x,y)    ((x) > (y)? (x) : (y))
#define min(x,y)    ((x) < (y)? (x) : (y))
#define myabs(x,y)  (((x) > (y))? ((x)-(y)) : ((y)-(x)))


#define  kernel(A)  A[(t+1)%2][x][y] = (2*A[(t)%2][x-2][y-2] + 4*A[(t)%2][x-2][y-1] + 5*A[(t)%2][x-2][y] + 4*A[(t)%2][x-2][y+1] + 2*A[(t)%2][x-2][y+2] + \
	 4*A[(t)%2][x-1][y-2] + 9*A[(t)%2][x-1][y-1] + 12*A[(t)%2][x-1][y] + 9*A[(t)%2][x-1][y+1] + 4*A[(t)%2][x-1][y+2] + \
	 5*A[(t)%2][x][y-2] + 12*A[(t)%2][x][y-1] + 15*A[(t)%2][x][y] + 12*A[(t)%2][x][y+1] + 5*A[(t)%2][x][y+2] + \
	 4*A[(t)%2][x+1][y-2] + 9*A[(t)%2][x+1][y-1] + 12*A[(t)%2][x+1][y] + 9*A[(t)%2][x+1][y+1] + 4*A[(t)%2][x+1][y+2] + \
	 2*A[(t)%2][x+2][y-2] + 4*A[(t)%2][x+2][y-1] + 5*A[(t)%2][x+2][y] + 4*A[(t)%2][x+2][y+1] + 2*A[(t)%2][x+2][y+2]) / 159
									   
#define XSLOPE 2
#define YSLOPE 2
#define XSTART 4
#define YSTART 4
#define DATA_TYPE double

int test(DATA_TYPE * B, int NX, int NY, int T, int Bx, int By, int tb);

